package com.paypal.android.MEP.a;

import android.content.Context;
import android.content.Intent;
import android.text.Editable;
import android.text.SpannableString;
import android.text.TextWatcher;
import android.text.style.UnderlineSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import com.paypal.android.MEP.PayPalActivity;
import com.paypal.android.MEP.l;
import com.paypal.android.MEP.p;
import com.paypal.android.a.q;
import com.paypal.android.b.m;
import com.paypal.android.b.n;
import java.util.Hashtable;
import java.util.Vector;

public final class g extends n
  implements TextWatcher, View.OnClickListener, com.paypal.android.MEP.r, com.paypal.android.b.i
{
  public static boolean a = false;
  private static com.paypal.android.b.f l = null;
  private i b;
  private Button c;
  private Button d;
  private Button e;
  private TextView f;
  private com.paypal.android.MEP.b.e g;
  private com.paypal.android.b.k h;
  private com.paypal.android.b.k i;
  private LinearLayout j;
  private RelativeLayout k;
  private TextView m;
  private com.paypal.android.MEP.b.h n;
  private com.paypal.android.b.a o;
  private WebView p;
  private String q;
  private Hashtable r = new Hashtable();

  public g(Context paramContext)
  {
    super(paramContext);
  }

  private void c()
  {
    int i1 = 1;
    String str1 = this.n.a();
    String str2 = this.n.b();
    int i2;
    if ((com.paypal.android.a.j.d(str1)) || (com.paypal.android.a.j.e(str1)))
    {
      i2 = i1;
      if ((str2 == null) || (str2.length() <= 0))
        break label90;
    }
    while (true)
    {
      if ((i2 != 0) && (i1 != 0))
      {
        this.n.d().setText("");
        a(i.b);
        p.a().a(this, str1, str2);
      }
      return;
      i2 = 0;
      break;
      label90: i1 = 0;
    }
  }

  private boolean f()
  {
    String str1 = this.n.a();
    String str2 = this.n.b();
    int i1;
    if ((com.paypal.android.a.j.d(str1)) || (com.paypal.android.a.j.e(str1)))
    {
      i1 = 1;
      if ((str2 == null) || (str2.length() <= 0))
        break label62;
    }
    label62: for (int i2 = 1; ; i2 = 0)
    {
      if ((i1 == 0) || (i2 == 0))
        break label68;
      return true;
      i1 = 0;
      break;
    }
    label68: return false;
  }

  public final void a()
  {
    com.paypal.android.a.c.f().a("usernameOrPhone", this.r.get("usernameOrPhone"));
    com.paypal.android.a.c.f().a("passwordOrPin", this.r.get("passwordOrPin"));
    com.paypal.android.a.c.f().a("delegate", this);
    com.paypal.android.a.c.f().a(0);
  }

  public final void a(int paramInt, Object paramObject)
  {
    com.paypal.android.a.c localc = com.paypal.android.a.c.f();
    if (this.b == i.b);
    switch (paramInt)
    {
    default:
      return;
    case 0:
    case 10:
    }
    localc.a("currentUser", this.n.a());
    if (com.paypal.android.MEP.e.a().A() == 3)
    {
      localc.k();
      return;
    }
    localc.j();
  }

  protected final void a(Context paramContext)
  {
    com.paypal.android.MEP.e locale = com.paypal.android.MEP.e.a();
    super.a(paramContext);
    this.b = i.a;
    LinearLayout localLinearLayout1 = com.paypal.android.a.f.a(paramContext, -1, -2);
    localLinearLayout1.setOrientation(1);
    localLinearLayout1.setPadding(5, 5, 5, 15);
    localLinearLayout1.addView(q.b(com.paypal.android.a.r.a, paramContext));
    this.g = new com.paypal.android.MEP.b.e(paramContext, this);
    this.g.a(this);
    localLinearLayout1.addView(this.g);
    LinearLayout localLinearLayout3;
    LinearLayout localLinearLayout5;
    if (locale.A() == 3)
    {
      this.g.a(false, true);
      addView(localLinearLayout1);
      this.j = new LinearLayout(paramContext);
      this.j.setOrientation(1);
      this.j.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
      this.j.setBackgroundDrawable(com.paypal.android.a.f.a());
      this.j.setPadding(10, 5, 10, 5);
      com.paypal.android.b.j localj = new com.paypal.android.b.j(com.paypal.android.a.j.a("ANDROID_login"), paramContext);
      this.j.addView(localj);
      this.h = new com.paypal.android.b.k(paramContext, m.a);
      this.h.a("Placeholder");
      this.h.setVisibility(8);
      this.h.setPadding(0, 5, 0, 5);
      this.j.addView(this.h);
      this.i = new com.paypal.android.b.k(paramContext, m.d);
      this.i.a(com.paypal.android.a.j.a("ANDROID_not_you_message"));
      this.i.setVisibility(8);
      this.i.setPadding(0, 5, 0, 5);
      this.j.addView(this.i);
      this.n = new com.paypal.android.MEP.b.h(paramContext);
      this.n.c().addTextChangedListener(this);
      this.n.d().addTextChangedListener(this);
      this.j.addView(this.n);
      LinearLayout localLinearLayout2 = com.paypal.android.a.f.a(paramContext, -1, -2);
      localLinearLayout2.setOrientation(0);
      localLinearLayout2.setGravity(16);
      localLinearLayout2.setPadding(5, 5, 5, 0);
      this.o = new com.paypal.android.b.a(paramContext);
      this.o.setChecked(locale.t());
      this.o.setOnClickListener(this);
      if (locale.u() == 1)
        localLinearLayout2.addView(this.o);
      this.p = new WebView(paramContext);
      this.p.setWebViewClient(new j(this));
      this.p.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
      this.p.setBackgroundColor(0);
      this.p.loadData("<html><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><head><style type=\"text/css\">b {color:#1B3664; font-family:Helvetica; font-size:12;}a {color:#686868; font-family:Helvetica; font-size:12;}</style></head><body><b>" + com.paypal.android.a.j.a("ANDROID_checkbox_opt_in") + "</b>" + "  " + "<a href=\"About.Quick.Pay\">" + com.paypal.android.a.j.a("ANDROID_checkbox_whats_this") + "</a>" + "</body>" + "</html>", "text/html", "utf-8");
      if (locale.u() == 1)
        localLinearLayout2.addView(this.p);
      this.j.addView(localLinearLayout2);
      localLinearLayout3 = com.paypal.android.a.f.a(paramContext, -1, -2);
      localLinearLayout3.setPadding(5, 5, 5, 5);
      localLinearLayout3.setOrientation(0);
      localLinearLayout3.setGravity(1);
      if ((locale.A() != 3) && (!locale.n()) && (!locale.C()))
        break label1287;
      this.d = null;
      this.e = new Button(paramContext);
      this.e.setLayoutParams(new LinearLayout.LayoutParams(-1, com.paypal.android.a.f.b()));
      this.e.setId(184424834);
      this.e.setText(com.paypal.android.a.j.a("ANDROID_login"));
      this.e.setTextColor(-16777216);
      this.e.setBackgroundDrawable(com.paypal.android.a.g.a());
      this.e.setOnClickListener(this);
      this.e.setEnabled(false);
      localLinearLayout3.addView(this.e);
      this.j.addView(localLinearLayout3);
      LinearLayout localLinearLayout4 = com.paypal.android.a.f.a(paramContext, -1, -2);
      localLinearLayout4.setPadding(5, 5, 5, 5);
      localLinearLayout4.setOrientation(0);
      localLinearLayout4.setGravity(1);
      this.c = new Button(paramContext);
      this.c.setLayoutParams(new LinearLayout.LayoutParams(-1, com.paypal.android.a.f.b()));
      this.c.setText(com.paypal.android.a.j.a("ANDROID_cancel"));
      this.c.setTextColor(-16777216);
      this.c.setBackgroundDrawable(com.paypal.android.a.g.b());
      this.c.setOnClickListener(this);
      localLinearLayout4.addView(this.c);
      this.j.addView(localLinearLayout4);
      this.f = q.a(com.paypal.android.a.r.f, paramContext);
      this.f.setLayoutParams(new RelativeLayout.LayoutParams(-1, -2));
      this.f.setPadding(10, 10, 10, 10);
      this.f.setTextColor(-16776961);
      this.f.setGravity(17);
      this.f.setOnClickListener(this);
      SpannableString localSpannableString = new SpannableString(com.paypal.android.a.j.a("ANDROID_help"));
      localSpannableString.setSpan(new UnderlineSpan(), 0, localSpannableString.length(), 0);
      this.f.setText(localSpannableString);
      this.f.setFocusable(true);
      this.j.addView(this.f);
      this.j.invalidate();
      addView(this.j);
      this.k = new RelativeLayout(paramContext);
      this.k.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
      this.k.setBackgroundDrawable(com.paypal.android.a.f.a());
      localLinearLayout5 = com.paypal.android.a.f.a(paramContext, -1, -2);
      RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(localLinearLayout5.getLayoutParams());
      localLayoutParams.addRule(13);
      localLinearLayout5.setLayoutParams(localLayoutParams);
      localLinearLayout5.setOrientation(1);
      localLinearLayout5.setGravity(1);
      if (l != null)
        break label1606;
      l = new com.paypal.android.b.f(paramContext);
    }
    while (true)
    {
      this.m = q.a(com.paypal.android.a.r.b, paramContext);
      this.m.setGravity(1);
      this.m.setTextColor(-13408615);
      this.m.setText(com.paypal.android.a.j.a("ANDROID_logging_in_message"));
      localLinearLayout5.addView(l);
      localLinearLayout5.addView(this.m);
      this.k.addView(localLinearLayout5);
      this.k.setVisibility(8);
      addView(this.k);
      if (locale.t())
      {
        a(i.b);
        this.n.d().setText("");
        com.paypal.android.a.c.f().a("delegate", this);
        com.paypal.android.a.c.f().a("quickPay", "false");
        com.paypal.android.a.c.f().a(10);
      }
      if (a)
        a(i.c);
      return;
      if (locale.G())
        break;
      this.g.a(false, false);
      break;
      label1287: LinearLayout localLinearLayout6 = com.paypal.android.a.f.a(paramContext, -1, -2);
      localLinearLayout6.setOrientation(1);
      localLinearLayout6.setPadding(5, 0, 5, 5);
      TextView localTextView = q.a(com.paypal.android.a.r.h, paramContext);
      localTextView.setTextColor(-16777216);
      localTextView.setText(com.paypal.android.a.j.a("ANDROID_review_text"));
      localTextView.setGravity(3);
      localLinearLayout6.addView(localTextView);
      this.j.addView(localLinearLayout6);
      this.d = new Button(paramContext);
      LinearLayout.LayoutParams localLayoutParams1 = new LinearLayout.LayoutParams(-1, com.paypal.android.a.f.b(), 0.5F);
      localLayoutParams1.setMargins(0, 0, 5, 0);
      this.d.setLayoutParams(localLayoutParams1);
      if (locale.l() == 1)
        this.d.setText(com.paypal.android.a.j.a("ANDROID_donate"));
      while (true)
      {
        this.d.setTextColor(-16777216);
        this.d.setBackgroundDrawable(com.paypal.android.a.g.a());
        this.d.setOnClickListener(this);
        this.d.setEnabled(false);
        localLinearLayout3.addView(this.d);
        this.e = new Button(paramContext);
        LinearLayout.LayoutParams localLayoutParams2 = new LinearLayout.LayoutParams(-1, com.paypal.android.a.f.b(), 0.5F);
        localLayoutParams2.setMargins(5, 0, 0, 0);
        this.e.setLayoutParams(localLayoutParams2);
        this.e.setId(184424834);
        this.e.setText(com.paypal.android.a.j.a("ANDROID_review"));
        this.e.setTextColor(-16777216);
        this.e.setBackgroundDrawable(com.paypal.android.a.g.b());
        this.e.setOnClickListener(this);
        this.e.setEnabled(false);
        localLinearLayout3.addView(this.e);
        break;
        this.d.setText(com.paypal.android.a.j.a("ANDROID_pay"));
      }
      label1606: ((LinearLayout)l.getParent()).removeAllViews();
    }
  }

  public final void a(i parami)
  {
    this.b = parami;
    h.b();
  }

  public final void a(com.paypal.android.b.h paramh, int paramInt)
  {
  }

  public final void a(String paramString)
  {
    a = false;
    this.q = paramString;
    if (this.b == i.b)
      a(i.c);
    while (this.b != i.d)
      return;
    a(i.c);
  }

  public final void a(String paramString, Object paramObject)
  {
    this.r.put(paramString, paramObject);
  }

  public final void afterTextChanged(Editable paramEditable)
  {
    if ((this.n.c().getText().length() > 0) && (this.n.d().getText().length() > 0))
    {
      if (this.e != null)
        this.e.setEnabled(true);
      if (this.d != null)
        this.d.setEnabled(true);
    }
    while (true)
    {
      d();
      return;
      if (this.e != null)
        this.e.setEnabled(false);
      if (this.d != null)
        this.d.setEnabled(false);
    }
  }

  public final i b()
  {
    return this.b;
  }

  public final void beforeTextChanged(CharSequence paramCharSequence, int paramInt1, int paramInt2, int paramInt3)
  {
  }

  public final void d()
  {
    if ((this.b == i.b) || (this.b == i.d))
    {
      this.g.a(false, true);
      this.j.setVisibility(8);
      this.k.setVisibility(0);
      l.a();
    }
    do
    {
      do
        return;
      while ((this.b != i.a) && (this.b != i.c));
      if (com.paypal.android.MEP.e.a().G())
        this.g.a(true, false);
      l.b();
      this.k.setVisibility(8);
      this.j.setVisibility(0);
    }
    while (this.b != i.c);
    if (a)
    {
      this.i.setVisibility(0);
      this.h.setVisibility(8);
      return;
    }
    this.i.setVisibility(8);
    this.h.setVisibility(0);
    this.h.a(this.q);
  }

  public final void e()
  {
    d();
  }

  public final void onClick(View paramView)
  {
    com.paypal.android.a.c localc = com.paypal.android.a.c.f();
    com.paypal.android.MEP.e locale = com.paypal.android.MEP.e.a();
    PayPalActivity localPayPalActivity = PayPalActivity.a();
    if (paramView == this.o)
      locale.b(this.o.isChecked());
    do
    {
      do
      {
        do
        {
          return;
          if (paramView == this.p)
          {
            h.a(1);
            return;
          }
          if (paramView != this.d)
            break;
        }
        while (!f());
        a(i.a);
        this.n.e();
        if (locale.k() == 2)
        {
          localPayPalActivity.a("27892", (String)localc.d("PaymentExecStatus"), true);
          return;
        }
        localc.a("quickPay", "true");
        c();
        return;
        if (paramView != this.e)
          break;
      }
      while (!f());
      a(i.a);
      this.n.e();
      if (locale.k() == 2)
      {
        if (locale.A() == 3)
        {
          l locall = locale.d();
          locall.b("2011-07-06T23:59:49.000-07:00");
          locall.c("2011-08-07T23:59:49.000-07:00");
          locall.b(true);
        }
        a.a = new Hashtable();
        Vector localVector1 = new Vector();
        Vector localVector2 = new Vector();
        com.paypal.android.a.a.c localc1 = new com.paypal.android.a.a.c();
        localc1.a("0");
        localc1.a = new com.paypal.android.a.a.a();
        localc1.a.b("USD");
        localc1.a.a("2.00");
        localc1.d = new Vector();
        com.paypal.android.a.a.k localk1 = new com.paypal.android.a.a.k();
        localk1.a = new com.paypal.android.a.a.a();
        localk1.a.b("USD");
        localk1.a.a("2.00");
        localk1.b = new com.paypal.android.a.a.g();
        localk1.b.a("2093");
        localk1.b.b("BANK_INSTANT");
        localc1.d.add(localk1);
        localVector1.add(localc1);
        com.paypal.android.a.a.c localc2 = new com.paypal.android.a.a.c();
        localc2.a("1");
        localc2.a = new com.paypal.android.a.a.a();
        localc2.a.b("USD");
        localc2.a.a("2.00");
        localc2.d = new Vector();
        com.paypal.android.a.a.k localk2 = new com.paypal.android.a.a.k();
        localk2.a = new com.paypal.android.a.a.a();
        localk2.a.b("USD");
        localk2.a.a("2.00");
        localk2.b = new com.paypal.android.a.a.g();
        localk2.b.a("9853");
        localk2.b.b("CREDITCARD");
        localc2.d.add(localk2);
        localVector1.add(localc2);
        com.paypal.android.a.a.c localc3 = new com.paypal.android.a.a.c();
        localc3.a("2");
        localc3.a = new com.paypal.android.a.a.a();
        localc3.a.b("USD");
        localc3.a.a("2.00");
        localc3.d = new Vector();
        com.paypal.android.a.a.k localk3 = new com.paypal.android.a.a.k();
        localk3.a = new com.paypal.android.a.a.a();
        localk3.a.b("USD");
        localk3.a.a("2.00");
        localk3.b = new com.paypal.android.a.a.g();
        localk3.b.a("9691");
        localk3.b.b("CREDITCARD");
        localc3.d.add(localk3);
        localVector1.add(localc3);
        a.a.put("FundingPlanId", "0");
        a.a.put("FundingPlans", localVector1);
        com.paypal.android.a.a.h localh1 = new com.paypal.android.a.a.h();
        localh1.a("Trenton");
        localh1.c("123 Home St");
        localh1.d("Apt B");
        localh1.e("08601");
        localh1.f("NJ");
        localh1.g("1");
        localh1.b("US");
        localVector2.add(localh1);
        com.paypal.android.a.a.h localh2 = new com.paypal.android.a.a.h();
        localh2.a("Hamlin");
        localh2.c("3012 Church Rd");
        localh2.d("");
        localh2.e("14464");
        localh2.f("NY");
        localh2.g("2");
        localh2.b("US");
        localVector2.add(localh2);
        a.a.put("ShippingAddressId", "1");
        a.a.put("AvailableAddresses", localVector2);
        PayPalActivity.a().sendBroadcast(new Intent(PayPalActivity.d));
        return;
      }
      localc.a("quickPay", "false");
      c();
      return;
      if (paramView == this.c)
      {
        new com.paypal.android.MEP.b.i(localPayPalActivity).show();
        return;
      }
    }
    while (paramView != this.f);
    h.a(2);
  }

  public final void onTextChanged(CharSequence paramCharSequence, int paramInt1, int paramInt2, int paramInt3)
  {
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.paypal.android.MEP.a.g
 * JD-Core Version:    0.6.2
 */